package zuo.Jiaoliang05;

public class jiao001 {
    public static int getNum(int[] arr){    //getNum(int[] arr)
        int ji=0;
        int ou=0;
        int cha=0;
        for (int i = 0; i < arr.length; i++) {
            if(arr[i]%2==0){
                ou+=arr[i];
            }else {
                ji+=arr[i];
            }
        }
        if(ji>ou){
            cha=ji-ou;
        }else {
            cha=ou-ji;
        }
        return  cha;
    }
    public static void main(String[] args) {
        int[] tt={1,1,2,3,3,4};
        int vi=getNum(tt);
        System.out.println("差值"+vi);

    }

}
